/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades.Revision;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Roggers
 */
@Entity
@Table(name = "informeformato")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Informeformato.findAll", query = "SELECT i FROM Informeformato i"),
    @NamedQuery(name = "Informeformato.findByIdInformeFormato", query = "SELECT i FROM Informeformato i WHERE i.idInformeFormato = :idInformeFormato"),
    @NamedQuery(name = "Informeformato.findByDetalle", query = "SELECT i FROM Informeformato i WHERE i.detalle = :detalle")})
public class Informeformato implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IdInformeFormato", nullable = false)
    private Integer idInformeFormato;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "detalle", nullable = false, length = 50)
    private String detalle;
    @JoinColumn(name = "IdInformeFormato", referencedColumnName = "IdFormato", nullable = false, insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Formato formato;
    @JoinColumn(name = "IdEditor", referencedColumnName = "IdEditor", nullable = false)
    @ManyToOne(optional = false)
    private Editor idEditor;

    public Informeformato() {
    }

    public Informeformato(Integer idInformeFormato) {
        this.idInformeFormato = idInformeFormato;
    }

    public Informeformato(Integer idInformeFormato, String detalle) {
        this.idInformeFormato = idInformeFormato;
        this.detalle = detalle;
    }

    public Integer getIdInformeFormato() {
        return idInformeFormato;
    }

    public void setIdInformeFormato(Integer idInformeFormato) {
        this.idInformeFormato = idInformeFormato;
    }

    public String getDetalle() {
        return detalle;
    }

    public void setDetalle(String detalle) {
        this.detalle = detalle;
    }

    public Formato getFormato() {
        return formato;
    }

    public void setFormato(Formato formato) {
        this.formato = formato;
    }

    public Editor getIdEditor() {
        return idEditor;
    }

    public void setIdEditor(Editor idEditor) {
        this.idEditor = idEditor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idInformeFormato != null ? idInformeFormato.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Informeformato)) {
            return false;
        }
        Informeformato other = (Informeformato) object;
        if ((this.idInformeFormato == null && other.idInformeFormato != null) || (this.idInformeFormato != null && !this.idInformeFormato.equals(other.idInformeFormato))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Revision.Informeformato[ idInformeFormato=" + idInformeFormato + " ]";
    }
    
}
